import React from 'react';
import {
    Scene,
    Router,
    Lightbox
} from 'react-native-router-flux';

import WelcomePage from "../ui/WelcomePage"
import MainTabPage from "../ui/MainTabPage";
import HomePage from "../ui/HomePage"
import TreePage from "../ui/TreePage"
import LoginPage from "../ui/LoginPage"
import RegisterPage from "../ui/RegisterPage"
import ArticleDetailPage from "../ui/ArticleDetailPage";
import SortDetailPage from "../ui/SortDetailPage";

import BackUtils from "../utils/BackUtils"

/**
 * 全局路由
 */
const getRouter = () => {
    return (
        <Router
            backAndroidHandler={
                BackUtils()}>
            <Lightbox>
                <Scene key="root"
                       titleStyle={{color: "#333333"}}>
                    <Scene key="WelcomePage">
                        <Scene key="WelcomePage" component={WelcomePage} hideNavBar hideTabBar hide/>
                    </Scene>
                    <Scene key="MainTabPage">
                        <Scene key="MainTabPage" component={MainTabPage} hideNavBar hideTabBar hide/>
                    </Scene>
                    <Scene key="HomePage">
                        <Scene key="HomePage" component={HomePage} hideNavBar hideTabBar hide/>
                    </Scene>
                    <Scene key="TreePage">
                        <Scene key="TreePage" component={TreePage} hideNavBar hideTabBar hide/>
                    </Scene>
                    <Scene key="RegisterPage">
                        <Scene key="RegisterPage" component={RegisterPage} hideNavBar hideTabBar hide/>
                    </Scene>
                    <Scene key="LoginPage">
                        <Scene key="LoginPage" component={LoginPage} hideNavBar hideTabBar hide/>
                    </Scene>
                    <Scene key="ArticleDetailPage">
                        <Scene key="ArticleDetailPage" component={ArticleDetailPage} hideNavBar hideTabBar hide/>
                    </Scene>
                    <Scene key="SortDetailPage">
                        <Scene key="SortDetailPage" component={SortDetailPage} hideNavBar hideTabBar hide/>
                    </Scene>
                </Scene>
            </Lightbox>
        </Router>
    )
};

export default getRouter;